package com.nakamachizu.util;

import org.mobylet.core.Carrier;
import org.mobylet.core.Mobylet;
import org.mobylet.core.MobyletFactory;

public class ForwardUtil {
    private static String JSP_PATH_DOCOMO = "/jsp/m/";
    private static String JSP_PATH_AU = "/jsp/m/";
    private static String JSP_PATH_SOFTBANK = "/jsp/m/";
    private static String JSP_PATH_OTHER = "/jsp/pc/";
    
    public static String forwardJsp(String jsp){
        Mobylet mobylet = MobyletFactory.getInstance();
        Carrier carrier = mobylet.getCarrier();

        jsp = jsp.replaceAll("^/", "");
        
        switch (carrier) {
        case DOCOMO:
            return JSP_PATH_DOCOMO + jsp;
        case AU:
            return JSP_PATH_AU + jsp;
        case SOFTBANK:
            return JSP_PATH_SOFTBANK + jsp;
        case OTHER:
            return JSP_PATH_OTHER + jsp;
        }


        return jsp;
    }
}
